try
{
	var graphics = new Graphics();
	var scene    = new Scene();
	
	scene.setNext(new SceneTitle());
	
	function loop()
	{
		var nextScene = scene.getNext();
		var ready     = true;
		if (nextScene)
		{
			var object;
			for (property in nextScene)
			{
				object = nextScene[property];
				if (((object instanceof Sprite) || (object instanceof Audio)) && !object.isReady())
				{
					ready = false;
					break;
				}
			}
		}
		if (ready)
		{
			graphics.update();
			scene.update();
			scene.draw(graphics.getContext());
		}
		setTimeout(loop, 32);
	}
	loop();
}
catch (error)
{
	alert(error.message);
}